import Input from "./input"
import List from "./list"
import { useState } from "react"
const Todolist = props => {
    // console.log(props)
    let [todo, setTodo] = useState([])
    let [arr, setArr] = useState([])
    function handleClick(er) {
        setTodo([er, ...todo])
    }
    const use = (we) => {
        let ad = todo.splice(we, 1)
        arr.push(ad)
        setArr([...arr])
        // console.log(todo)
        setTodo([...todo])


    }
    return (
        <fieldset>
            <Input abc={handleClick}></Input>
            <List todo={todo} a1={use} done={arr}></List>
        </fieldset>
    )
}
export default Todolist